package com.ruoyi.coronary.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.coronary.mapper.CoronaryMessageMapper;
import com.ruoyi.coronary.domain.CoronaryMessage;
import com.ruoyi.coronary.service.ICoronaryMessageService;

/**
 * 消息Service业务层处理
 * 
 * @author wky
 * @date 2024-04-09
 */
@Service
public class CoronaryMessageServiceImpl implements ICoronaryMessageService 
{
    @Autowired
    private CoronaryMessageMapper coronaryMessageMapper;

    /**
     * 查询消息
     * 
     * @param messageId 消息主键
     * @return 消息
     */
    @Override
    public CoronaryMessage selectCoronaryMessageByMessageId(Long messageId)
    {
        return coronaryMessageMapper.selectCoronaryMessageByMessageId(messageId);
    }

    /**
     * 查询消息列表
     * 
     * @param coronaryMessage 消息
     * @return 消息
     */
    @Override
    public List<CoronaryMessage> selectCoronaryMessageList(CoronaryMessage coronaryMessage)
    {
        return coronaryMessageMapper.selectCoronaryMessageList(coronaryMessage);
    }

    /**
     * 新增消息
     * 
     * @param coronaryMessage 消息
     * @return 结果
     */
    @Override
    public int insertCoronaryMessage(CoronaryMessage coronaryMessage)
    {
        coronaryMessage.setCreateTime(DateUtils.getNowDate());
        return coronaryMessageMapper.insertCoronaryMessage(coronaryMessage);
    }

    /**
     * 修改消息
     * 
     * @param coronaryMessage 消息
     * @return 结果
     */
    @Override
    public int updateCoronaryMessage(CoronaryMessage coronaryMessage)
    {
        return coronaryMessageMapper.updateCoronaryMessage(coronaryMessage);
    }

    /**
     * 批量删除消息
     * 
     * @param messageIds 需要删除的消息主键
     * @return 结果
     */
    @Override
    public int deleteCoronaryMessageByMessageIds(Long[] messageIds)
    {
        return coronaryMessageMapper.deleteCoronaryMessageByMessageIds(messageIds);
    }

    /**
     * 删除消息信息
     * 
     * @param messageId 消息主键
     * @return 结果
     */
    @Override
    public int deleteCoronaryMessageByMessageId(Long messageId)
    {
        return coronaryMessageMapper.deleteCoronaryMessageByMessageId(messageId);
    }
}
